import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '工作地点',
    align: "center",
    dataIndex: 'workPlace'
  },
  {
    title: '工作地址',
    align: "center",
    dataIndex: 'workPlaceAddress'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'workPlaceDesc'
  },
  {
    title: '创建人',
    align: "center",
    dataIndex: 'createBy'
  },
  {
    title: '创建日期',
    align: "center",
    sorter: true,
    dataIndex: 'createTime'
  },
  {
    title: '更新人',
    align: "center",
    dataIndex: 'updateBy'
  },
  {
    title: '更新日期',
    align: "center",
    sorter: true,
    dataIndex: 'updateTime'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "工作地点",
    field: 'workPlace',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "备注",
    field: 'workPlaceDesc',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "创建日期",
    field: 'createTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "更新日期",
    field: 'updateTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '工作地点',
    field: 'workPlace',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'workPlaceDesc',
    component: 'InputTextArea',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  workPlace: {title: '工作地点',order: 0,view: 'text', type: 'string',},
  workPlaceDesc: {title: '备注',order: 1,view: 'textarea', type: 'string',},
  createBy: {title: '创建人',order: 2,view: 'text', type: 'string',},
  createTime: {title: '创建日期',order: 3,view: 'datetime', type: 'string',},
  updateBy: {title: '更新人',order: 4,view: 'text', type: 'string',},
  updateTime: {title: '更新日期',order: 5,view: 'datetime', type: 'string',},
};
